﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Kojarskiy.Core
{
    public enum MessageType { Success, Information, Warning, Error, Exception}

    public class Message
    {
        public MessageType Type { get; set; }
        public DateTime Publication { get; set; }
        public string Information { get; set; }
        public Message(MessageType type, string information)
        {
            Publication = DateTime.Now;
            Type = type;
            Information = information;
        }

        public bool IsNullOrEmpty()
        {
            return string.IsNullOrEmpty(Information);
        }
        public string Fomat()
        {
            switch (Type)
            {
                case MessageType.Success:
                    return "<div class=\"alert alert-success\">" + Information + "</div>";
                case MessageType.Information:
                    return "<div class=\"alert alert-info\">" + Information + "</div>";
                case MessageType.Warning:
                    return "<div class=\"alert alert-warning\">" + Information + "</div>";
                case MessageType.Error:
                    return "<div class=\"alert alert-danger\">" + Information + "</div>";
                case MessageType.Exception:
                    return "<div class=\"alert alert-danger\">" + Information + "</div>";
                default:
                    return "<div class=\"alert alert-info\">" + Information + "</div>"; 
            }

        }
    }
}